<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>金币录入管理</title>
	<meta name="decorator" content="default"/>
<script type="text/javascript">
	//改变状态
	function onlyuse(){		
			var id=$("#goldcoinid").val();
			var branchid=$("#branchid").val();
  		    $.ajax({  
			        type:"POST",  
			         url: "${ctx}/goldinput/goldcoin/onlyUserCorn",
			         dataType:'json', 
			         data:{"id":id },
			         async:false,  
			         success:function(result){
			        	if(result.code='02'){
			        	 window.location.href="${ctx}/goldinput/goldcoin/distributequery?branchId="+branchid;}
				        },
			          error:function(data){
			        	 alert("出错了,！！");
			        	 },   
		    });		
		}	
  </script>
</head>
<body>	
	<li>金币管理->金币发行详情</li>
	<form:form id="inputForm" modelAttribute="goldcoinWapper"  class="form-horizontal">

		
		<sys:message content="${message}"/>	
		
	<div class="control-group">
			<label class="control-label">请选择金币：</label>
			<div class="controls">
			 
			<form:input path="goldcoinmark" htmlEscape="false" id="activityname" readonly= "true" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
		
		    </div>
		
			<div class="control-group">
			<label class="control-label"  >规则配置：</label>
		<p>	
		
		<div class="controls"  name="div_num"     id="1">
		<table  class="table">
         <c:forEach items="${list}" var="GoldcoinRelateRulesVo">
         
         <tr >
           <td width="400px">
            ${GoldcoinRelateRulesVo.rulesetname }
           </td>
			<td width="100px">
                                       发放金币 
           </td>   
	      <td  width="100px">
	         <c:if test="${'01' eq GoldcoinRelateRulesVo.distributiostyle}">
              ${GoldcoinRelateRulesVo.fixeddistributionnumber }   
              </c:if>  
              <c:if test="${'02' eq GoldcoinRelateRulesVo.distributiostyle}">
              ${GoldcoinRelateRulesVo.percent }   
              </c:if>  
              <c:if test="${'03' eq GoldcoinRelateRulesVo.distributiostyle}">
              ${GoldcoinRelateRulesVo.random }   
              </c:if>  
                          
           </td> 
		
		  <td  >
           <c:if test="${'01' eq GoldcoinRelateRulesVo.distributiostyle}">
		      固定发放个数
          </c:if>
           <c:if test="${'02' eq GoldcoinRelateRulesVo.distributiostyle}">
		  百分比
          </c:if>
           <c:if test="${'03' eq GoldcoinRelateRulesVo.distributiostyle}">
		    随机
          </c:if>
           </td> 
		</tr>	
		</c:forEach>
		</table>
		</div>
		</p>
		
		</div>
			
		<div class="control-group">
			<label class="control-label"  >名称：</label>
			<div class="controls">
			    <form:input path="goldcoinid" htmlEscape="false" maxlength="80" id="goldcoinid"  style="display:none"  class="input-xlarge required"/>
				<form:input path="applystaffid" htmlEscape="false" maxlength="80" id="applystaffid"  style="display:none"  class="input-xlarge required"/>
				<form:input path="goldcoinname" id="goldcoinname"  htmlEscape="false" maxlength="80" readonly= "true"  class="input-xlarge required"/>
				<form:input path="branchid" htmlEscape="false" maxlength="80" id="branchid"  style="display:none"  class="input-xlarge required"/>
				<input name="list" value="${list}" id="goldcoinname"  htmlEscape="false" maxlength="80" style="display:none"   class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">标识：</label>
			<div class="controls">
				<form:input path="goldcoinmark" htmlEscape="false" id="goldcoinmark" readonly= "true"  maxlength="50" class="input-xlarge required"    onblur="markValidate()"/>
				<input name="branchid" id="branchid"  style="display:none"  htmlEscape="false" value="${goldbranchid }"  maxlength="50" class="input-xlarge required"   "/>
			    <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">金币所属活动：</label>
			<div class="controls">
			<form:input path="activityname" htmlEscape="false" id="activityname" readonly= "true"  maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">领取时间：</label>
			<div class="controls">
				<input name="goldcoincollectionstart" id="goldcoincollectionstart"     type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${goldcoinWapper.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					/>
			至
				<input name="goldcoincollectionend" id="goldcoincollectionend"   type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${goldcoinWapper.goldcoincollectionend}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">限领个数：</label>
			<div class="controls">
				<form:input path="goldcoinlimitnumber" id="goldcoinlimitnumber"    htmlEscape="false" maxlength="8" readonly= "true"   class="input-small "/> 单位：个
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">发行总个数：</label>
			<div class="controls">
				<form:input path="goldcoindistributiontotalnumber"  id="goldcoindistributiontotalnumber" htmlEscape="false" readonly= "true"   maxlength="8" class="input-small required" /> 单位：个
			    <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">金币有限期类型</label>
			<div class="controls">
		   <c:if
				  test="${'01' eq goldcoinWapper.goldcoinvaliditystyle}">
				  固定时间段
			</c:if>	
			<c:if
				  test="${'02' eq goldcoinWapper.goldcoinvaliditystyle}">
				  按季度计算有效期
			</c:if>	
			<c:if
				  test="${'03' eq goldcoinWapper.goldcoinvaliditystyle}">
				  有效天数
			</c:if>	
				<span class="help-inline"><font color="red">*</font> </span>
		</div>
		</div>
		<div class="control-group"  >
			<label class="control-label">金币有效期：</label>
			<div class="controls" >
				<c:if
				  test="${'01' eq goldcoinWapper.goldcoinvaliditystyle}">
				  <fmt:formatDate value="${goldcoinWapper.goldcoinvaliditystart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至      <fmt:formatDate value="${goldcoinWapper.goldcoinvalidityend}" pattern="yyyy-MM-dd HH:mm:ss"/> </c:if>	
			<c:if
				  test="${'02' eq goldcoinWapper.goldcoinvaliditystyle}">
				  <fmt:formatDate value="${goldcoinWapper.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至      <fmt:formatDate value="${goldcoinWapper.goldcoinvalidityend}" pattern="yyyy-MM-dd HH:mm:ss"/> </c:if>	
			<c:if
				  test="${'03' eq goldcoinWapper.goldcoinvaliditystyle}">
				<fmt:formatDate value="${goldcoinWapper.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至   
				<fmt:formatDate value="${goldcoinWapper.goldcoininvalidity}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</c:if>
			</div>
		</div>	
		<div class="control-group">
			<label class="control-label">描述：</label>
			<div class="controls">
				<form:input path="description"  id="description"   readonly= "true"  htmlEscape="false" maxlength="200" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
      	<c:if
	       test="${'04' eq goldcoinWapper.status}">
				 
		<div class="form-actions">
			<shiro:hasPermission name="goldinput:goldcoin:edit">
			 <input type="button" id="btn_save1" value="仅使用，暂停发行"
				style="width: 120px; height: 40px; margin-top: 00px; background-color: #5599FF; color: #FFFFFF"
				onclick="onlyuse()" />

			</shiro:hasPermission>
			
		</div> 
				
     </c:if>

	</form:form>
	
	</body>



</html>